#!/bin/sh

CUR_TIME=`date +log:%Y%m%d_%H%M%S`
if [ $# = 1 ]; then
    str=$1
else
    str=$CUR_TIME
fi

echo -e '\033[032m ------------- git commit start ------------ \033[0m'

# clean source
echo -e '\033[032m clean source ... \033[0m'

# add
echo -e '\033[032m git add -A . \033[0m'
git add -A .

# git commit
echo -e '\033[032m git commit  \033[0m'
git commit -m "$str"
echo -e '\033[032m git push  \033[0m'
git push origin master

echo -e '\033[032m ------------- git commit end ------------ \033[0m'